package com.song.book.book;

import com.netflix.hystrix.contrib.javanica.annotation.HystrixCommand;
import com.song.book.book.service.BookSerivce;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

import javax.annotation.Resource;

@RestController
public class HelloController {

      @Resource
      private BookSerivce bookSerivce;

      @GetMapping("/feign-test")
      @HystrixCommand(fallbackMethod = "abc")
      public String say(){
          return this.bookSerivce.testUser();
      }

      public String abc(){
          return "对不起，熔断了！。。。。。";
      }

}
